package com.annie.piglatin;

import com.qustom.dialog.QustomDialogBuilder;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;

public class MyDialogFragment extends DialogFragment {

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
    	String pigLatin = getArguments().getString(MainActivity.PIGLATIN_KEY);
    	this.setCancelable(false);
    	Drawable icon = getResources().getDrawable(R.drawable.ic_launcher);
    	int pink = getResources().getColor(R.color.pink);
    	return new QustomDialogBuilder(getActivity())
    			.setTitle("Latin")
    	        .setTitleColor(pink)
    	        .setIcon(icon)
    	        .setDividerColor(pink)
    	        .setMessage(pigLatin)
    	        .setPositiveButton("Clear", new DialogInterface.OnClickListener() {

                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                    	((MainActivity) getActivity()).resetText();
                    }
                }).create();
    }
}
